Skip to content

Added CreateArchToSharedObjectsMapTask.#2023

Closed
priettt wants to merge 7 commits intomainfrom
priettt/archsToSharedObjectsMap
Closed

Added CreateArchToSharedObjectsMapTask.#2023
priettt wants to merge 7 commits intomainfrom
priettt/archsToSharedObjectsMap

Conversation

@priettt
Copy link
Copy Markdown
Contributor

@priettt priettt commented Mar 12, 2025

Goal

This is one of the 4 tasks NdkUploadTask will get separated into.

This task receives a directory with architectures as its input, and outputs a map of each architecture to a list with every shared object file path of that architecture.

For instance, if the input directory is this:

archs 
| - - - - armeabi-v7a
             | - - - - libtest1.so
             | - - - - libtest2.so
| - - - - arm64-v8a
             | - - - - libtest3.so
             | - - - - libtest4.so

The result will be this map:

armeabi-v7a -> [path to libtest1.so, path to libtest2.so]
arm64-v8a -> [path to libtest3.so, path to libtest4.so]

I also moved the logic to find the architecture directories to the task registration, so it's passed as a provider to the task.

Testing

Added an integration test for the task, still need to test the registration.

@priettt priettt requested a review from a team as a code owner March 12, 2025 15:13
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 12, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

@priettt priettt force-pushed the priettt/archsToSharedObjectsMap branch from 83109d9 to 97a521a Compare March 13, 2025 02:56
Comment on lines +21 to +22
* 1. Compresses each shared object file using Zstd compression
* 2. Stores the compressed files in compressedSharedObjectFilesDirectory, preserving the architecture directory structure
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realise we were doing Zstd compression on SO files. IMO it'd be worth breaking that into a separate task that takes the uncompressed SO files as an input and the compressed files as an output. Sorry for the confusion from our discussion yesterday


// Serialize the map to JSON and write it to the output file
val serializableMap = ArchitecturesToHashedSharedObjectFilesMap(outputMap)
architecturesToHashedSharedObjectFilesMap.get().asFile.outputStream().use { outputStream ->
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
architecturesToHashedSharedObjectFilesMap.get().asFile.outputStream().use { outputStream ->
architecturesToHashedSharedObjectFilesMap.get().asFile.outputStream().use { outputStream ->

It'd be worth using a buffered stream here to improve perf

}

private fun getUnitySharedObjectFiles(project: Project, data: AndroidCompactedVariantData): File {
// TODO: Verify if errors should be thrown if the directories or SO files are not found. Improve error messaging.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these todo comments new or were they present in the previous code that's been adapted into this source file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are new, I'm adding them so I can then think about any uncommon codepaths

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.40%. Comparing base (c659d7d) to head (18abadd).
Report is 9 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2023      +/-   ##
==========================================
+ Coverage   85.25%   85.40%   +0.14%     
==========================================
  Files         464      466       +2     
  Lines       10518    10523       +5     
  Branches     1556     1558       +2     
==========================================
+ Hits         8967     8987      +20     
+ Misses        875      858      -17     
- Partials      676      678       +2     

see 22 files with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@priettt priettt closed this Mar 13, 2025
@priettt priettt deleted the priettt/archsToSharedObjectsMap branch April 25, 2025 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants